
function GetFileInfo()
{
	flashpoint();

	printf('# API: GetFileInfo(file-index,path,name,length,status) ');
	printf('# returns image file information  ');
	printf('# OUTPUT FORMAT: ');
	printf('# file-index path name (length status) ');
	printf('# lists these bits if value is ON ');
	printf('# ptyp,piav,ipcm,piwm,prmd,ped1,ped2 ');
	printf(' ');
	
  writeMenu('"GetFileInfo"','"CMD"','"GetFileInfo()"');
  writeVariables();
	printf('# GetFileInfo parameters ');
	printf('declare s: spath,fname');
	printf('declare u: ulength ');
	printf('declare b: bstatus' );
  	printf('declare b: ptyp,piav,ipcm,piwm,prmd,ped1,ped2');
  	
  printf('<br>','#**** OPEN FILE ****');  
  printf('outFile="/System/ZFInfo.txt"');
  writeFileOpen();

	printf('WriteLine(fd," ") ');
	printf('WriteLine(fd," API: GetFileInfo(file-index,path,name,length,status) ")');
	printf('WriteLine(fd," returns image file information  ")');
	printf('WriteLine(fd," OUTPUT FORMAT: ")');
	printf('WriteLine(fd," file-index path name (length status) ")');
	printf('WriteLine(fd," lists these bits if value is ON ")');
	printf('WriteLine(fd," ptyp,piav,ipcm,piwm,prmd,ped1,ped2 ")');
	printf('WriteLine(fd," ") ');
	printf(' ');	

  printf('GetFileCount(uvar) ');
  printf('# use count(int) for unsigned int (uvar)');
  printf('count=uvar');
  printf('DisplayLine(count, " images on disk") ');
  printf('WriteLine(fd, count, " images on disk ") ');
  
  printf('findex=0');

	// initialize the bits
  for( i=1 ; i< fileinfoBits.length ; i++ )
  	printf( fileinfoBits[i].param  ,' = ', fileinfoBits[i].bit );

  
  printf(' ');
  printf('# ************** ');
  printf('LOOP: ');

  printf('status = GetFileInfo(findex,spath,fname,ulength,bstatus) ');

  printf('DisplayLine("(",findex,") ",spath) ');
  printf('DisplayLine( fname ) ');
  printf('DisplayLine( "(",ulength,",", bstatus,")" ) ');
  printf('Wait(1000) ');

  printf('WriteLine(fd,findex,")",spath," ",fname,"(",ulength,",",bstatus,")" )');
	
// code to display ON bits
	for(i=1 ; i<fileinfoBits.length ; i++)
	{
		printf(' ');
		printf(' if bstatus & ',fileinfoBits[i].param  );
		printf(' Display("',fileinfoBits[i].param, '") ');
		printf(' WriteLine( fd,"', fileinfoBits[i].param,'" ) ');
		printf('end ');
	}

  printf('Wait(100)');
  printf('DisplayLine(" ")');
  printf('if findex < count - 1 ');
  printf('findex = findex + 1 ');
  printf('goto LOOP ');
  printf('end ');

  writeFileClose();

	printf('exitscript');
}





function GetNewFileInfo()
{
	flashpoint();

	printf('# API: GetNewFileInfo(file-index,path,name,length,status) ');
	printf('# returns image file information  ');
	printf('# OUTPUT FORMAT: ');
	printf('# file-index path name (length status) ');
	printf('# lists these bits if value is ON ');
	printf('# ptyp,piav,ipcm,piwm,prmd,ped1,ped2 ');
	printf(' ');
	

  writeMenu('"GetNewFileInfo"','"CMD"','"GetNewFileInfo()"');
  writeVariables();
	printf('# GetNewFileInfo parameters ');
	printf('declare s: spath,fname');
	printf('declare u: ulength ');
	printf('declare b: bstatus' );
  
  printf('<br>','#**** OPEN FILE ****');  
  printf('outFile="/System/ZNFInfo.txt"');
  writeFileOpen();


	printf('WriteLine(fd," ") ');
	printf('WriteLine(fd," API: GetNewFileInfo(file-index,path,name,length,status) ")');
	printf('WriteLine(fd," returns image file information   ")');
	printf('WriteLine(fd," OUTPUT FORMAT:  ")');
	printf('WriteLine(fd," file-index path name (length status)  ")');
	printf('WriteLine(fd," lists these bits if value is ON  ")');
	printf('WriteLine(fd," ptyp,piav,ipcm,piwm,prmd,ped1,ped2  ")');
	printf('WriteLine(fd," ") ');
	

  printf('GetNewFileCount(uvar) ');
  printf('# use count(int) for unsigned int (uvar)');
  printf('count=uvar');
  printf('DisplayLine(count, " images on disk") ');
  printf('WriteLine(fd, count, " images on disk ") ');

  printf('findex=0');
  
  printf(' ');
  printf('# ************** ');
  printf('LOOP: ');

  printf('status = GetNewFileInfo(findex,spath,fname,ulength,bstatus) ');

  printf('DisplayLine("(",findex,") ",spath) ');
  printf('DisplayLine( fname ) ');
  printf('DisplayLine( "(",ulength,",", bstatus,")" ) ');
  printf('Wait(1000) ');

  printf('WriteLine(fd,findex,")",spath," ",fname,"(",ulength,",",bstatus,")" )');

  printf('if findex < count - 1 ');
  printf('findex = findex + 1 ');
  printf('goto LOOP ');
  printf('end ');

  writeFileClose();

  printf('exitscript');
	
}




